﻿@model ScrumProject.ViewModels.ProjectIndexData

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>My Projects</h2>

<table class="table">
    <tr>
        <th>
            Name
        </th>
        <th>
            Description
        </th>
        <th></th>
    </tr>

@foreach (var item in Model.Projects) {
    string selectedRow = "";
    if (item.Id == ViewBag.ProjectID)
    {
        selectedRow = "selectedrow";
    } 
    <tr class="@selectedRow" valign="top">
        <td><center>
            @Html.DisplayFor(modelItem => item.Name)</center>
        </td>
        <td><center>
            @Html.DisplayFor(modelItem => item.Description)</center>
        </td>
        <td><center>
            @Html.ActionLink(item.Name, "Details", "Project", new { id = item.Id }, null) </center>
        </td>
    </tr>
}

</table>